package personal.xzhang.swing.jwizard.sample;

import javax.swing.JOptionPane;

import personal.xzhang.swing.jwizard.JWizardDialog;

public class SampleDialog extends JWizardDialog {

    private static final long serialVersionUID = 21L;

    public SampleDialog(SampleCards steps) {
        super(steps);
        nextButton_.setEnabled(true);
    }

    protected void gotoNext() {
        steps_.showItem(steps_.getCurrentPanel().getNextStepIndex());
    }

    protected void gotoPrevious() {
        steps_.showItem(steps_.getCurrentPanel().getPreviousStepIndex());
    }

    protected void cancel() {
        int response = JOptionPane.showConfirmDialog(this,
                "Do you want cancel the installation?", "Cancel Installation",
                JOptionPane.OK_CANCEL_OPTION);
        if (response == JOptionPane.OK_OPTION)
            dispose();
    }
}
